/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mechanatrix.terrain;

import com.jme3.app.SimpleApplication;
import com.jme3.light.AmbientLight;
import com.jme3.light.DirectionalLight;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Spatial;
import com.jme3.shadow.DirectionalLightShadowRenderer;
import com.jme3.util.SkyFactory;

/**
 *
 * @author dnigels
 */
public class TestOilRefinery extends SimpleApplication {

	public static void main(String[] args) {
		TestOilRefinery app = new TestOilRefinery();
		app.start();
	}

	@Override
	public void simpleInitApp() {

		this.flyCam.setMoveSpeed(100f);

		Spatial refinery = assetManager.loadModel("Models/architecture/refinery.obj");
		refinery.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
		refinery.scale(FastMath.pow(2f, -4f));
		rootNode.attachChild(refinery);
		
		AmbientLight light = new AmbientLight();
		light.setColor(ColorRGBA.LightGray);
		rootNode.addLight(light);

		DirectionalLight sun = new DirectionalLight();
		sun.setDirection(new Vector3f(-0.1f, -0.1f, 1.0f));
		rootNode.addLight(sun);

		DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, 1024, 3);
		dlsr.setLight(sun);
		viewPort.addProcessor(dlsr);
		rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Cool Cloud Sunset.dds", false));

		//this.cam.lookAtDirection(new Vector3f(0.5f, 0f, 0.5f), Vector3f.UNIT_Y);
	}
}
